﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DoAnTN.Entity;
namespace DoAnTN.Buissiness
{
    
    class LoaiPhongDAO
    {
        private static DBUtil objDB = new DBUtil();
        private static SqlConnection conn = null;

        public static string tenLoaiPhong(string maLoaiPhong) {
            String tenLoaiPhong = null;
            conn = objDB.connect();
            conn.Open();
            SqlCommand objCmd = new SqlCommand("select TenLoaiPhong from LoaiPhong where MaLoaiPhong='"+maLoaiPhong+"'", conn);
            SqlDataReader dataReader = objCmd.ExecuteReader();
            while (dataReader.Read())
            {
                tenLoaiPhong = dataReader.GetValue(0).ToString();
            }
            conn.Close();
            return tenLoaiPhong;
        }
    }
}
